import { defineStore } from 'pinia'

type UserState = {
  token: string
}

const useUserStore = defineStore('user', {
  state: (): UserState => ({
    token: '',
  }),
  persist: true,
})

export default useUserStore

// 定义 State 接口  
// interface AppState {  
//   token: string | null;  
//   siderType: string;  
//   lang: string;  
// }  

// interface RootState {  
//   app: AppState;  
// }  

// export default {  
//   token: (state: RootState): string | null => state.app.token,  

//   siderType: (state: RootState): string => state.app.siderType,  

//   lang: (state: RootState): string => state.app.lang  
// }
